import { Injectable } from '@angular/core';

import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';

import { Global } from 'src/global';

@Injectable({
  providedIn: 'root'
})
export class IndexService {

  constructor(private http: HttpClient) { }
  url =Global.commonURL+"/index"

  getPockemons(page:number=1):Observable<any>{
    return this.http.get(this.url+"?page="+page)
  }
  addCollection(collection:object){
    return this.http.post(Global.commonURL+"/addcomment",collection)
  }
}
